package com.study.es.web;

import com.study.es.bean.UserInfo;
import com.study.es.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/save")
    public Object save(@RequestBody UserInfo userInfo) {
        userService.save(userInfo);
        return "success";
    }

    @GetMapping("/get/{id}")
    public Object get(@PathVariable String id) {
        return userService.get(id);
    }

    @GetMapping("/list")
    public Object list() {
        return userService.list();
    }


}
